home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume25 / byte-benchmarks3.1 / part01 next >
Encoding:
Text File  |  1992-02-01  |  62.7 KB  |  2,156 lines

  1. Newsgroups: comp.sources.unix
  2. From: ben@bytepb.byte.com (Ben Smith @ BYTE)
  3. Subject: v25i108: BYTE Benchmarks, V3.1, Part01/04
  4. Sender: sources-moderator@pa.dec.com
  5. Approved: vixie@pa.dec.com
  6.  
  7. Submitted-By: ben@bytepb.byte.com (Ben Smith @ BYTE)
  8. Posting-Number: Volume 25, Issue 108
  9. Archive-Name: byte-benchmarks3.1/part01
  10.  
  11. [ This is a benchmark suite similar in spirit to SPEC, except that it's
  12.   smaller and contains mostly things like "sieve" and "dhrystone".  If
  13.   you are comparing different UN*X machines for performance, this gives
  14.   fairly good numbers.  Note that the numbers aren't useful for anything
  15.   except (perhaps, as in "maybe") for comparison against the same bench-
  16.   mark suite run on some other system.                           --vix ]
  17.  
  18. #! /bin/sh
  19. # This is a shell archive.  Remove anything before this line, then unpack
  20. # it by saving it into a file and typing "sh file".  To overwrite existing
  21. # files, type "sh file -c".  You can also feed this as standard input via
  22. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  23. # will see the following message at the end:
  24. #        "End of archive 1 (of 4)."
  25. # Contents:  MANIFEST README doc doc/bench3.doc pgms pgms/byte.logo
  26. #   pgms/cleanup.sh pgms/fs.awk pgms/index.awk pgms/index.base
  27. #   pgms/index.sh pgms/loopm.awk pgms/loops.awk pgms/multi.sh
  28. #   pgms/report.awk pgms/report.sh pgms/tst.sh results src src/arith.c
  29. #   src/context1.c src/execl.c src/getopt.c src/hanoi.c src/limit.c
  30. #   src/looper.c src/pipe.c src/spawn.c src/syscall.c src/timeit.c
  31. #   testdir testdir/dc.dat tmp
  32. # Wrapped by vixie@cognition.pa.dec.com on Sun Feb  2 16:27:40 1992
  33. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  34. if test -f 'MANIFEST' -a "${1}" != "-c" ; then 
  35.   echo shar: Will not clobber existing file \"'MANIFEST'\"
  36. else
  37. echo shar: Extracting \"'MANIFEST'\" \(1491 characters\)
  38. sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
  39. X   File Name        Archive #    Description
  40. X-----------------------------------------------------------
  41. X MANIFEST                   1    
  42. X Makefile                   2    
  43. X README                     1    
  44. X Run                        3    
  45. X doc                        1    
  46. X doc/bench.doc              3    
  47. X doc/bench3.doc             1    
  48. X pgms                       1    
  49. X pgms/byte.logo             1    
  50. X pgms/cleanup.sh            1    
  51. X pgms/fs.awk                1    
  52. X pgms/index.awk             1    
  53. X pgms/index.base            1    
  54. X pgms/index.sh              1    
  55. X pgms/loopm.awk             1    
  56. X pgms/loops.awk             1    
  57. X pgms/multi.sh              1    
  58. X pgms/report.awk            1    
  59. X pgms/report.sh             1    
  60. X pgms/tst.sh                1    
  61. X results                    1    
  62. X results/reports.shar       2    
  63. X src                        1    
  64. X src/arith.c                1    
  65. X src/big.c                  3    
  66. X src/context1.c             1    
  67. X src/dhry.h                 4    
  68. X src/dhry_1.c               3    
  69. X src/dhry_2.c               2    
  70. X src/dummy.c                2    
  71. X src/execl.c                1    
  72. X src/fstime.c               2    
  73. X src/getopt.c               1    
  74. X src/hanoi.c                1    
  75. X src/limit.c                1    
  76. X src/looper.c               1    
  77. X src/pipe.c                 1    
  78. X src/spawn.c                1    
  79. X src/syscall.c              1    
  80. X src/timeit.c               1    
  81. X testdir                    1    
  82. X testdir/cctest.c           2    
  83. X testdir/dc.dat             1    
  84. X testdir/sort.src           2    
  85. X tmp                        1    
  86. END_OF_FILE
  87. if test 1491 -ne `wc -c <'MANIFEST'`; then
  88.     echo shar: \"'MANIFEST'\" unpacked with wrong size!
  89. fi
  90. # end of 'MANIFEST'
  91. fi
  92. if test -f 'README' -a "${1}" != "-c" ; then 
  93.   echo shar: Will not clobber existing file \"'README'\"
  94. else
  95. echo shar: Extracting \"'README'\" \(6548 characters\)
  96. sed "s/^X//" >'README' <<'END_OF_FILE'
  97. Version 3.6 -- 5/15/91  19:30:16
  98. X
  99. X================================================================
  100. To use the new BYTE Unix Benchmarks:
  101. X
  102. X   make 
  103. X   Run
  104. X
  105. X================================================================
  106. You may run individual benchmark programs and groups of programs.
  107. There are also a few options.
  108. X
  109. X  Run [<bench> ...] [<group> ...] [-qvd]
  110. X
  111. X    -q    quiet        no output to standard out
  112. X    -v    verbose        extra output to standard out
  113. X    -d    debug        Run is displayed as it is run
  114. X
  115. X     GROUP    BENCHMARK    EXPLANATION        SOURCE
  116. X     --------   -----------    --------------------    -------------
  117. X     index                      only those need for 
  118. X                                generating the BYTE
  119. X                                index
  120. X        double        double arithmetic    src/arith.c
  121. X        dhry2        dhrystone 2 w/o regs    src/dhry_1.c
  122. X                            src/dhry_2.c
  123. X                            src/dhry.h
  124. X        execl        execl call        src/execl.c
  125. X                            src/big.c
  126. X        fstime        filesystem throughput    src/fstime.c
  127. X        pipe        pipe throughput        src/pipe.c
  128. X        shell       load system with    pgms/multi.sh
  129. X                  concurrent shell    pgms/tst.sh
  130. X                  scripts        src/looper.c
  131. X     arithmetic
  132. X        arithoh        arithmetic overhead     src/arith.c
  133. X        register    register arithmetic    src/arith.c
  134. X        short        short arithmetic    src/arith.c
  135. X        int        int arithmetic        src/arith.c
  136. X        long        long arithmetic        src/arith.c
  137. X        float        float arithmetic    src/arith.c
  138. X        double        double arithmetic    src/arith.c
  139. X     system
  140. X        syscall        system call overhead    src/syscall.c
  141. X        pipe        pipe throughput        src/pipe.c
  142. X        context1    pipe context switch    src/context1.c
  143. X        spawn        process creation    src/spawn.c
  144. X        execl        execl call        src/execl.c
  145. X        fstime        filesystem throughput    src/fstime.c
  146. X     misc
  147. X        C        compile and link    /bin/cc
  148. X                            src/looper.c
  149. X        dc        calculations with dc    testdir/dc.dat
  150. X                            src/looper.c
  151. X        hanoi        recursion         src/hanoi.c
  152. X                            src/looper.c
  153. X     dhry
  154. X        dhry2        dhrystone 2 w/o regs    src/dhry_1.c
  155. X                            src/dhry_2.c
  156. X                            src/dhry.h
  157. X        dhry2reg    dhrystone 2 with regs    src/dhry_1.c
  158. X                            src/dhry_2.c
  159. X                            src/dhry.h
  160. X        shell       load system with    pgms/multi.sh
  161. X                  concurrent shell    pgms/tst.sh
  162. X                  scripts
  163. X                        ** Most C programs also include src/timeit.c
  164. X
  165. X===================== RELEASE NOTES =====================================
  166. X
  167. X========================  May 91 ==========================
  168. This is version 3. This set of programs should be able to determine if
  169. your system is BSD or SysV. (It uses the output format of time (1)
  170. to see. If you have any problems, contact me (by email,
  171. preferably): ben@bytepb.byte.com
  172. X
  173. X---
  174. X
  175. The document doc/bench.doc describes the basic flow of the
  176. benchmark system. The document doc/bench3.doc describes the major
  177. changes in design of this version. As a user of the benchmarks,
  178. you should understand some of the methods that have been
  179. implemented to generate loop counts:
  180. X
  181. Tests that are compiled C code:
  182. X  The function wake_me(second, func) is included (from the file
  183. timeit.c). This function uses signal and alarm to set a countdown
  184. for the time request by the benchmark administration script
  185. X(Run). As soon as the clock is started, the test is run with a
  186. counter keeping track of the number of loops that the test makes.
  187. When alarm sends its signal, the loop counter value is sent to stderr
  188. and the program terminates. Since the time resolution, signal
  189. trapping and other factors don't insure that the test is for the
  190. precise time that was requested, the test program is also run
  191. from the time (1) command. The real time value returned from time
  192. X(1) is what is used in calculating the number of loops per second
  193. X(or minute, depending on the test).  As is obvious, there is some
  194. overhead time that is not taken into account, therefore the
  195. number of loops per second is not absolute. The overhead of the
  196. test starting and stopping and the signal and alarm calls is
  197. common to the overhead of real applications. If a program loads
  198. quickly, the number of loops per second increases; a phenomenon
  199. that favors systems that can load programs quickly. (Setting the
  200. sticky bit of the test programs is not considered fair play.)
  201. X
  202. Test that use existing UNIX programs or shell scripts:
  203. X  The concept is the same as that of compiled tests, except the
  204. alarm and signal are contained in separate compiled program,
  205. looper (source is looper.c). Looper uses an execvp to invoke the
  206. test with its arguments. Here, the overhead includes the
  207. invocation and execution of looper.
  208. X
  209. X--
  210. X
  211. The index numbers are generated from a baseline file that is in
  212. pgms/index.base. You can put tests that you wish in this file.
  213. All you need to do is take the results/log file from your
  214. baseline machine, edit out the comment and blank lines, and sort
  215. the result (vi/ex command: 1,$!sort). The sort in necessary
  216. because the process of generating the index report uses join (1).
  217. You can regenerate the reports by running "make report."
  218. X
  219. X--
  220. X
  221. X========================= Jan 90 =============================
  222. Tom Yager has joined the effort here at BYTE; he is responsible
  223. for many refinements in the UNIX benchmarks.
  224. X
  225. The memory access tests have been deleted from the benchmarks.
  226. The file access tests have been reversed so that the test is run
  227. for a fixed time. The amount of data transfered (written, read,
  228. and copied) is the variable. !WARNING! This test can eat up a
  229. large hunk of disk space.
  230. X
  231. The initial line of all shell scripts has been changed from the
  232. SCO and XENIX form (:) to the more standard form "#! /bin/sh".
  233. But different systems handle shell switching differently. Check
  234. the documentation on your system and find out how you are
  235. supposed to do it. Or, simpler yet, just run the benchmarks from
  236. the Bourne shell. (You may need to set SHELL=/bin/sh as well.)
  237. X
  238. The options to Run have not been checked in a while. They may no
  239. longer function. Next time, I'll get back on them. There needs to
  240. be another option added (next time) that halts testing between
  241. each test. !WARNING! Some systems have caches that are not getting flushed
  242. before the next test or iteration is run. This can cause
  243. erroneous values. 
  244. X
  245. X========================= Sept 89 =============================
  246. The database (db) programs now have a tuneable message queue space.
  247. queue space. The default set in the Run script is 1024 bytes.
  248. Other major changes are in the format of the times. We now show
  249. Arithmetic and Geometric mean and standard deviation for User
  250. Time, System Time, and Real Time. Generally, in reporting, we
  251. plan on using the Real Time values with the benchs run with one
  252. active user (the bench user). Comments and arguments are requested.
  253. X
  254. contact: BIX bensmith or rick_g
  255. END_OF_FILE
  256. if test 6548 -ne `wc -c <'README'`; then
  257.     echo shar: \"'README'\" unpacked with wrong size!
  258. fi
  259. chmod +x 'README'
  260. # end of 'README'
  261. fi
  262. if test ! -d 'doc' ; then
  263.     echo shar: Creating directory \"'doc'\"
  264.     mkdir 'doc'
  265. fi
  266. if test -f 'doc/bench3.doc' -a "${1}" != "-c" ; then 
  267.   echo shar: Will not clobber existing file \"'doc/bench3.doc'\"
  268. else
  269. echo shar: Extracting \"'doc/bench3.doc'\" \(2369 characters\)
  270. sed "s/^X//" >'doc/bench3.doc' <<'END_OF_FILE'
  271. The BYTE Unix benchmarks that we published in March, 1990, we
  272. expected that they fill our needs for several years. It was only a
  273. few months before we started to see that UNIX workstation performance
  274. was going to make the benchmark design questionable. The design flaw
  275. was that the benchmarks timed a fixed number of loops; if there were
  276. to few loops, the times were too small to be reliable. Perhaps we
  277. could have increased the number of loops and been safe for another
  278. few years (months?). But with IBM's introduction of the RS/6000, it
  279. became obvious that we needed to redesign our benchmarks.
  280. X
  281. Now the work on version 3 is complete. The new design increases in
  282. precision on faster workstations because we turned everything
  283. upside-down: we count loops for a fixed amount of time. There are
  284. some additional benefits, the amount of time for running the suite is
  285. relative predictable (about an hour). 
  286. X
  287. Since new benchmarks mean new baselines and indexes, we reevaluated
  288. these elements as well. Though the Everex Step 386/33 is still a very
  289. contemporary machine, the operating system that we were using for the
  290. baseline (SCO Xenix 386 version 2.3.1). We were tempted to use the
  291. new HP 9000 Series 700 as the baseline, but so few machines are in
  292. that league that the index would be very strange. Instead, we have
  293. taken the conservative approach: a popular machine.  The new baseline
  294. machine is the Sun Microsystems [TOM, please fill in configuration],
  295. the baseline for this month's roundup of SPARC clones.
  296. X
  297. We also changed which benchmark tests are used to generate the new
  298. index: 
  299. X * a double precision arithmetic performance test
  300. X * Dhrystone 2 without register variables 
  301. X * Spawning a process (!M!execl()!EM!)
  302. X * File copy throughput in five seconds
  303. X * Pipe-based context switching
  304. X * The shell script with 8 concurrent scripts running
  305. X
  306. Instead of just summing the indexes of each of these tests to get the
  307. overall index, we are using the average. This means that the baseline
  308. value is 1 instead of six.
  309. X
  310. As always, the BYTE Unix benchmarks are freely available from BIX and
  311. on the Usenet. Version 3 automatically configures to System V and BSD
  312. Unix systems. It also includes scripts for generating the indexes.
  313. Thanks to the many users who sent use reports and suggestions for
  314. Version 2, BYTE and you have a much better set of tools for
  315. benchmarking UNIX systems.
  316. X
  317. END_OF_FILE
  318. if test 2369 -ne `wc -c <'doc/bench3.doc'`; then
  319.     echo shar: \"'doc/bench3.doc'\" unpacked with wrong size!
  320. fi
  321. chmod +x 'doc/bench3.doc'
  322. # end of 'doc/bench3.doc'
  323. fi
  324. if test ! -d 'pgms' ; then
  325.     echo shar: Creating directory \"'pgms'\"
  326.     mkdir 'pgms'
  327. fi
  328. if test -f 'pgms/byte.logo' -a "${1}" != "-c" ; then 
  329.   echo shar: Will not clobber existing file \"'pgms/byte.logo'\"
  330. else
  331. echo shar: Extracting \"'pgms/byte.logo'\" \(1395 characters\)
  332. sed "s/^X//" >'pgms/byte.logo' <<'END_OF_FILE'
  333. X
  334. X         ############   #####        ## ############### ###############
  335. X         ############## #####        ## ############### ###############
  336. X         #####       ## #####        ##      #####      #####         
  337. X         #####       ## #####        ##      #####      #####         
  338. X         #####       ## #####        ##      #####      #####         
  339. X         ############   #####       ##       #####      ###############
  340. X         #############   ######### ##        #####      ###############
  341. X         #####       ##   ##########         #####      #####         
  342. X         #####       ##      #####           #####      #####         
  343. X         #####       ##      #####           #####      #####         
  344. X         #####       ##      #####           #####      #####         
  345. X         ##############      #####           #####      ###############
  346. X         ############        #####           #####      ###############
  347. X
  348. X
  349. X   #    #  #    #  #  #    #          #####   ######  #    #   ####   #    #
  350. X   #    #  ##   #  #   #  #           #    #  #       ##   #  #    #  #    #
  351. X   #    #  # #  #  #    ##            #####   #####   # #  #  #       ######
  352. X   #    #  #  # #  #    ##            #    #  #       #  # #  #       #    #
  353. X   #    #  #   ##  #   #  #           #    #  #       #   ##  #    #  #    #
  354. X    ####   #    #  #  #    #          #####   ######  #    #   ####   #    #
  355. X
  356. END_OF_FILE
  357. if test 1395 -ne `wc -c <'pgms/byte.logo'`; then
  358.     echo shar: \"'pgms/byte.logo'\" unpacked with wrong size!
  359. fi
  360. chmod +x 'pgms/byte.logo'
  361. # end of 'pgms/byte.logo'
  362. fi
  363. if test -f 'pgms/cleanup.sh' -a "${1}" != "-c" ; then 
  364.   echo shar: Will not clobber existing file \"'pgms/cleanup.sh'\"
  365. else
  366. echo shar: Extracting \"'pgms/cleanup.sh'\" \(2621 characters\)
  367. sed "s/^X//" >'pgms/cleanup.sh' <<'END_OF_FILE'
  368. X#! /bin/sh
  369. X###############################################################################
  370. X#  The BYTE UNIX Benchmarks - Release 3
  371. X#          Module: cleanup.sh   SID: 3.5 5/15/91 19:30:26
  372. X#          
  373. X###############################################################################
  374. X# Bug reports, patches, comments, suggestions should be sent to:
  375. X#
  376. X#    Ben Smith or Rick Grehan at BYTE Magazine
  377. X#    ben@bytepb.UUCP    rick_g@bytepb.UUCP
  378. X#
  379. X###############################################################################
  380. X#  Modification Log:
  381. X#  added report for dhrystones 6/89 - ben
  382. X#
  383. X###############################################################################
  384. ID="@(#)cleanup.sh:3.5 -- 5/15/91 19:30:26";
  385. X#
  386. X# $Header: cleanup,v 5.2 88/01/07 10:58:24 kenj Exp $
  387. X#
  388. X#  Cleanup when an iterative test terminates
  389. X#
  390. BINDIR=${BINDIR-./pgms}
  391. log=${LOG-./results/log}
  392. timeaccum=${TIMEACCUM-./results/times}
  393. flavor="${FLAVOR-SysV}"
  394. while ( test $# -ge 1 )
  395. do
  396. X    opt=$1
  397. X    shift
  398. X    case $opt
  399. X      in
  400. X
  401. X    -a) : abort
  402. X    echo '' >>$LOGFILE
  403. X    echo '**************************' >>$LOGFILE
  404. X    echo '* Benchmark Aborted .... *' >>$LOGFILE
  405. X    echo '**************************' >>$LOGFILE
  406. X    echo
  407. X    echo 'Benchmark Aborted ....'    # notice displayed on screen
  408. X    echo "" >>$LOGFILE
  409. X    echo " " `who | wc -l` "interactive users." >>$LOGFILE
  410. X    echo "" >>$LOGFILE
  411. X    date=`date`
  412. X    echo "End Benchmark Run ($date) ...." >>$LOGFILE
  413. X    echo "End Benchmark Run ($date) ...."
  414. X    ;;
  415. X
  416. X
  417. X    -f) : filesystem throughput
  418. X    awk -f ${BINDIR}/fs.awk <$1 >>$LOGFILE
  419. X    cat $1 >> $timeaccum 2>/dev/null
  420. X    rm -f $1
  421. X    shift
  422. X    ;;
  423. X    
  424. X    -d) : dhrystone evaluation
  425. X    awk -f ${BINDIR}/dhry.awk <$1 >>$LOGFILE
  426. X    cat $1 >> $timeaccum 2>/dev/null
  427. X    rm -f $1
  428. X    shift
  429. X    ;;
  430. X    -l) : loops per second for a specified time evaluation
  431. X    awk -f ${BINDIR}/loops.awk  <$1 >>$LOGFILE
  432. X    cat $1 >> $timeaccum 2>/dev/null
  433. X    rm -f $1
  434. X    shift
  435. X    ;;
  436. X    
  437. X    
  438. X    -m) : loops per minute for a specified time evaluation
  439. X    awk -f ${BINDIR}/loopm.awk  <$1 >>$LOGFILE
  440. X    cat $1 >> $timeaccum 2>/dev/null
  441. X    rm -f $1
  442. X    shift
  443. X    ;;
  444. X    
  445. X    -i) : report last iteration
  446. X    echo "Terminated during iteration $1" >>$LOGFILE
  447. X    shift
  448. X    ;;
  449. X
  450. X    -L) : logfile
  451. X    LOGFILE=$1
  452. X    shift
  453. X    ;;
  454. X    
  455. X    -r) : reason for failure
  456. X    echo $1
  457. X    echo $1 >>$LOGFILE
  458. X    shift
  459. X    ;;
  460. X
  461. X    -m) : mem throughput tests
  462. X    awk -f ${BINDIR}/mem.awk <$1 >>$LOGFILE
  463. X    cat $1 >> $timeaccum 2>/dev/null
  464. X    rm -f $1
  465. X    shift
  466. X    ;;
  467. X
  468. X    -t) : timing with /bin/time
  469. X    awk -f ${BINDIR}/time.awk <$1 >>$LOGFILE
  470. X    cat $1 >> $timeaccum 2>/dev/null
  471. X    rm -f $1
  472. X    shift
  473. X    ;;
  474. X
  475. X
  476. X    '') : 'skip it (residual effect of shifts)'
  477. X    ;;
  478. X
  479. X    *)
  480. X    echo "cleanup: bad option ($opt)" >>$LOGFILE
  481. esac
  482. done
  483. exit
  484. END_OF_FILE
  485. if test 2621 -ne `wc -c <'pgms/cleanup.sh'`; then
  486.     echo shar: \"'pgms/cleanup.sh'\" unpacked with wrong size!
  487. fi
  488. chmod +x 'pgms/cleanup.sh'
  489. # end of 'pgms/cleanup.sh'
  490. fi
  491. if test -f 'pgms/fs.awk' -a "${1}" != "-c" ; then 
  492.   echo shar: Will not clobber existing file \"'pgms/fs.awk'\"
  493. else
  494. echo shar: Extracting \"'pgms/fs.awk'\" \(1992 characters\)
  495. sed "s/^X//" >'pgms/fs.awk' <<'END_OF_FILE'
  496. X###############################################################################
  497. X#  The BYTE UNIX Benchmarks - Release 3
  498. X#          Module: fs.awk   SID: 3.4 5/15/91 19:30:24
  499. X#          
  500. X###############################################################################
  501. X# Bug reports, patches, comments, suggestions should be sent to:
  502. X#
  503. X#    Ben Smith or Tom Yager at BYTE Magazine
  504. X#    ben@bytepb.byte.com   tyager@bytepb.byte.com
  505. X#
  506. X###############################################################################
  507. X#  Modification Log:
  508. X#       added geometric mean 8/6/89 -ben
  509. X#       modified for new version of fstime 11/15/89 -ben
  510. X#       removed variance 10/23/90 -ben
  511. X#
  512. X###############################################################################
  513. BEGIN   { w_product = 0.0000;
  514. X    r_product = 0.0000;
  515. X    c_product = 0.0000;
  516. X    iter=0;
  517. X    w_too_quick=0;
  518. X    r_too_quick=0;
  519. X    c_too_quick=0;
  520. X    }
  521. X/FLAVOR\|/ { split($0, junk,"|");
  522. X    flavor=junk[2] ;
  523. X        }
  524. X/real/    { iter++; ok++; next; }
  525. X/user/    { if (flavor == "SysV") {next;} }
  526. X/sys/    { if (flavor == "SysV") {next;} }
  527. X/^$/    { next; } 
  528. X/^#/    { next; } 
  529. X/sample/ { sample = $1; next; }
  530. X/fstime/ {
  531. X         print "** Iteration ",iter," Failed: ",$0; 
  532. X     ok--;
  533. X         fail=1;
  534. X         } 
  535. X/write/ { if (!fail) {
  536. X           w+=$1;
  537. X           w2+=$1*$1;
  538. X           w_product += log($1); 
  539. X           }
  540. X        }
  541. X/read/  { if (!fail) {
  542. X           r+=$1;
  543. X           r2+=$1*$1;
  544. X           r_product += log($1); 
  545. X           }
  546. X        }
  547. X/copy/  { if (!fail) {
  548. X           c+=$1;
  549. X           c2+=$1*$1;
  550. X           c_product += log($1);
  551. X           }
  552. X    }
  553. XEND {
  554. X    if (ok > 0) {
  555. X# TestName|Sample(seconds)|Unit(KiloBytes/sec)|ArithMean|GeoMean|DataPoints
  556. X        printf "File Read  (%d seconds)|%d|KBps|%.0f|%.0f|%d\n",sample,sample,r/ok,exp(r_product/ok),ok;
  557. X        printf "File Write (%d seconds)|%d|KBps|%.0f|%.0f|%d\n",sample,sample,w/ok,exp(w_product/ok),ok;
  558. X        printf "File Copy  (%d seconds)|%d|KBps|%.0f|%.0f|%d\n",sample,sample,c/ok,exp(c_product/ok),ok;
  559. X    } else {
  560. X        print "File I/O|  no measured results|"
  561. X    }
  562. X    }
  563. END_OF_FILE
  564. if test 1992 -ne `wc -c <'pgms/fs.awk'`; then
  565.     echo shar: \"'pgms/fs.awk'\" unpacked with wrong size!
  566. fi
  567. chmod +x 'pgms/fs.awk'
  568. # end of 'pgms/fs.awk'
  569. fi
  570. if test -f 'pgms/index.awk' -a "${1}" != "-c" ; then 
  571.   echo shar: Will not clobber existing file \"'pgms/index.awk'\"
  572. else
  573. echo shar: Extracting \"'pgms/index.awk'\" \(497 characters\)
  574. sed "s/^X//" >'pgms/index.awk' <<'END_OF_FILE'
  575. BEGIN    { 
  576. X    FS="|" ; 
  577. X    sum=0.00; 
  578. X    n=0;
  579. X    printf("\n                     INDEX VALUES            \n");
  580. X    printf("TEST%40sBASELINE     RESULT      INDEX\n\n","");
  581. X
  582. X    }
  583. X
  584. X    { # process all lines - use geometric means
  585. X    idex = $10/$5;
  586. X    sum += idex;
  587. X    ++n;
  588. X    printf("%-40s  %10.1f %10.1f %10.1f\n",$1,$5,$10,idex);
  589. X    }
  590. X
  591. XEND    {
  592. X    printf("              %30s                     =========\n","");
  593. X    printf("     SUM of %2d items  %30s  %20.1f\n",n,"",sum);
  594. X    printf("     AVERAGE          %30s  %20.1f\n","",sum/n);
  595. X    }
  596. END_OF_FILE
  597. if test 497 -ne `wc -c <'pgms/index.awk'`; then
  598.     echo shar: \"'pgms/index.awk'\" unpacked with wrong size!
  599. fi
  600. chmod +x 'pgms/index.awk'
  601. # end of 'pgms/index.awk'
  602. fi
  603. if test -f 'pgms/index.base' -a "${1}" != "-c" ; then 
  604.   echo shar: Will not clobber existing file \"'pgms/index.base'\"
  605. else
  606. echo shar: Extracting \"'pgms/index.base'\" \(314 characters\)
  607. sed "s/^X//" >'pgms/index.base' <<'END_OF_FILE'
  608. Arithmetic Test (type = double)|10.0|lps|2541.7|2541.7|6
  609. Dhrystone 2 without register variables|10.0|lps|22366.4|22366.3|6
  610. XExecl Throughput Test|9.4|lps|16.5|16.5|6
  611. XFile Copy  (30 seconds)|30|KBps|179|179|6
  612. Pipe-based Context Switching Test|10.0|lps|1318.5|1318.5|6
  613. Shell scripts (8 concurrent)|60.1|lpm|4.0|4.0|3
  614. END_OF_FILE
  615. if test 314 -ne `wc -c <'pgms/index.base'`; then
  616.     echo shar: \"'pgms/index.base'\" unpacked with wrong size!
  617. fi
  618. chmod +x 'pgms/index.base'
  619. # end of 'pgms/index.base'
  620. fi
  621. if test -f 'pgms/index.sh' -a "${1}" != "-c" ; then 
  622.   echo shar: Will not clobber existing file \"'pgms/index.sh'\"
  623. else
  624. echo shar: Extracting \"'pgms/index.sh'\" \(1541 characters\)
  625. sed "s/^X//" >'pgms/index.sh' <<'END_OF_FILE'
  626. X##############################################################################
  627. X#  The BYTE UNIX Benchmarks - Release 3
  628. X#          Module: index.sh   SID: 3.5 5/15/91 19:30:24
  629. X#          
  630. X##############################################################################
  631. X# Bug reports, patches, comments, suggestions should be sent to:
  632. X#
  633. X#    Ben Smith or Tom Yager at BYTE Magazine
  634. X#    ben@bytepb.byte.com   tyager@byptepb.byte.com
  635. X#
  636. X##############################################################################
  637. X# generate an index from test log
  638. X# 
  639. X#############################################################################
  640. X#  Modification Log:
  641. X#        created 4/1/91 - Ben Smith
  642. X#
  643. X##############################################################################
  644. BINDIR=${BINDIR-pgms}
  645. BASE=${BASE-pgms/index.base}
  646. TARGET=${TARGET-results/log}
  647. TEMP=/tmp/$$.dat
  648. X#
  649. X# BASELINE DATA
  650. X#
  651. if [ $# -lt 1 ]
  652. then
  653. X    echo "Data File for baseline: \c"
  654. X    read BASE
  655. else
  656. X    BASE=$1
  657. fi
  658. X# check for existance
  659. if [ ! -r ${BASE} ]
  660. then
  661. X    echo "Cannot open $BASE for reading"
  662. X    exit 1
  663. fi
  664. X#
  665. X# RESULTS TARGET
  666. X#
  667. if [ $# -lt 2 ]
  668. then
  669. X    echo "Source File for target machine results: \c"
  670. X    read TARGET
  671. else
  672. X    TARGET=$2
  673. fi
  674. X# check for existance
  675. if [ ! -r ${TARGET} ]
  676. then
  677. X    echo "Cannot open $TARGET for reading"
  678. X    exit 1
  679. fi
  680. X#
  681. X# make dat file for results
  682. X sort $TARGET > ${TEMP}
  683. X#
  684. X# DESTINATION
  685. X#
  686. if [ $# -eq 3 ]
  687. then
  688. X    DEST=$3
  689. X    join -t'|' ${BASE} ${TEMP} | awk -f ${BINDIR}/index.awk > ${DEST}
  690. else
  691. X    join -t'|' ${BASE} ${TEMP} | awk -f ${BINDIR}/index.awk
  692. fi
  693. X
  694. X# cleanup
  695. rm -f ${TEMP}
  696. X
  697. X
  698. X
  699. END_OF_FILE
  700. if test 1541 -ne `wc -c <'pgms/index.sh'`; then
  701.     echo shar: \"'pgms/index.sh'\" unpacked with wrong size!
  702. fi
  703. chmod +x 'pgms/index.sh'
  704. # end of 'pgms/index.sh'
  705. fi
  706. if test -f 'pgms/loopm.awk' -a "${1}" != "-c" ; then 
  707.   echo shar: Will not clobber existing file \"'pgms/loopm.awk'\"
  708. else
  709. echo shar: Extracting \"'pgms/loopm.awk'\" \(1800 characters\)
  710. sed "s/^X//" >'pgms/loopm.awk' <<'END_OF_FILE'
  711. X###############################################################################
  712. X#  The BYTE UNIX Benchmarks - Release 1
  713. X#          Module: loopm.awk   SID: 1.4 5/15/91 19:30:25
  714. X#      LOOPS per minute
  715. X#          
  716. X###############################################################################
  717. X# Bug reports, patches, comments, suggestions should be sent to:
  718. X#
  719. X#    Ben Smith or Tom Yager at BYTE Magazine
  720. X#    ben@bytepb.byte.com   tyager@bytepb.byte.com
  721. X#
  722. X###############################################################################
  723. X#  Modification Log:
  724. X#        created 2/12/91 -ben
  725. X#
  726. X###############################################################################
  727. BEGIN { rsum = 0.000; r2sum = 0.000; r_product = 0.0000;
  728. X      iter = 0; Test=""; SubTest=""; secs = 0.00; secs_sum = 0.00;
  729. X      mins = 0.000; time_str=""; flavor="SysV";
  730. X    }
  731. X/TEST\|/ { split($0, junk,"|");
  732. X    Test=junk[2]; 
  733. X    }
  734. X/FLAVOR\|/ { split($0, junk,"|");
  735. X    flavor=junk[2] ; 
  736. X    }
  737. X/loops/ { loops=$1; 
  738. X    iter ++;
  739. X        }
  740. X/real/    { if (flavor == "SysV") {time_str = $2; }
  741. X      else { time_str = $1; }
  742. X    # determine seconds from time_str
  743. X    if ( time_str ~/\:/)
  744. X       {
  745. X       split(time_str,junk,":");
  746. X       secs = 60 * junk[1] + junk[2];
  747. X       }
  748. X    else { secs = time_str; }
  749. X    mins=secs/60.000; 
  750. X    print mins;
  751. X    if(loops) { rsum += loops/mins;
  752. X        r2sum += (loops*loops)/(mins*mins);
  753. X        r_product += (log(loops)-log(mins));
  754. X        secs_sum += secs;
  755. X        }
  756. X    }  
  757. X/user/    { if (flavor == "SysV") { next;} } # don't use these times
  758. X/sys/    { if (flavor == "SysV") { next;} } # don't use these times
  759. X#/^$/    { next } 
  760. XEND {
  761. X    if (iter > 0) {  
  762. X# TestName|Sample(seconds)|units|ArithMean|GeoMean|DataPoints
  763. X        printf("%s|%.1f|lpm|%.1f|%.1f|%d\n",Test,secs_sum/iter,rsum/iter,exp(r_product/iter),iter);
  764. X        }
  765. X    else { 
  766. X        printf("%s|  no measured results|\n",Test); 
  767. X        }
  768. X    }
  769. END_OF_FILE
  770. if test 1800 -ne `wc -c <'pgms/loopm.awk'`; then
  771.     echo shar: \"'pgms/loopm.awk'\" unpacked with wrong size!
  772. fi
  773. chmod +x 'pgms/loopm.awk'
  774. # end of 'pgms/loopm.awk'
  775. fi
  776. if test -f 'pgms/loops.awk' -a "${1}" != "-c" ; then 
  777.   echo shar: Will not clobber existing file \"'pgms/loops.awk'\"
  778. else
  779. echo shar: Extracting \"'pgms/loops.awk'\" \(1716 characters\)
  780. sed "s/^X//" >'pgms/loops.awk' <<'END_OF_FILE'
  781. X###############################################################################
  782. X#  The BYTE UNIX Benchmarks - Release 1
  783. X#          Module: loops.awk   SID: 1.4 5/15/91 19:30:25
  784. X#      LOOPS per second
  785. X#          
  786. X###############################################################################
  787. X# Bug reports, patches, comments, suggestions should be sent to:
  788. X#
  789. X#    Ben Smith or Tom Yager at BYTE Magazine
  790. X#    ben@bytepb.byte.com   tyager@bytepb.byte.com
  791. X#
  792. X###############################################################################
  793. X#  Modification Log:
  794. X#        created 2/12/91 -ben
  795. X#
  796. X###############################################################################
  797. BEGIN { rsum = 0.000; r2sum = 0.000; r_product = 0.0000;
  798. X      iter = 0; Test=""; SubTest=""; secs = 0.00; secs_sum = 0.00;
  799. X    }
  800. X/TEST\|/ { split($0, junk,"|");
  801. X    Test=junk[2]; 
  802. X    }
  803. X/FLAVOR\|/ { split($0, junk,"|");
  804. X    flavor=junk[2] ; 
  805. X    }
  806. X/loops/ { loops=$1; 
  807. X    iter ++;
  808. X        }
  809. X/real/    { if (flavor == "SysV") {time_str=$2; }
  810. X      else {time_str=$1; }
  811. X    # determine seconds from time_str
  812. X    if ( time_str ~/\:/)
  813. X       {
  814. X       split(time_str,junk,":");
  815. X       secs = 60 * junk[1] + junk[2];
  816. X       }
  817. X    else { secs = time_str; }
  818. X    if(loops) { rsum += loops/secs;
  819. X        r2sum += (loops*loops)/(secs*secs);
  820. X        r_product += (log(loops)-log(secs));
  821. X        secs_sum += secs;
  822. X        }
  823. X    }  
  824. X/user/    { if (flavor == "SysV") { next;} } # don't use these times
  825. X/sys/    { if (flavor == "SysV") { next;} } # don't use these times
  826. X#/^$/    { next } 
  827. XEND {
  828. X    if (iter > 0) {  
  829. X# TestName|Sample(seconds)|units|ArithMean|GeoMean|DataPoints
  830. X        printf("%s|%.1f|lps|%.1f|%.1f|%d\n",Test,secs_sum/iter,rsum/iter,exp(r_product/iter),iter)
  831. X        }
  832. X    else { 
  833. X        printf("%s|  no measured results|\n",Test); 
  834. X        }
  835. X    }
  836. END_OF_FILE
  837. if test 1716 -ne `wc -c <'pgms/loops.awk'`; then
  838.     echo shar: \"'pgms/loops.awk'\" unpacked with wrong size!
  839. fi
  840. chmod +x 'pgms/loops.awk'
  841. # end of 'pgms/loops.awk'
  842. fi
  843. if test -f 'pgms/multi.sh' -a "${1}" != "-c" ; then 
  844.   echo shar: Will not clobber existing file \"'pgms/multi.sh'\"
  845. else
  846. echo shar: Extracting \"'pgms/multi.sh'\" \(704 characters\)
  847. sed "s/^X//" >'pgms/multi.sh' <<'END_OF_FILE'
  848. X#! /bin/sh
  849. X###############################################################################
  850. X#  The BYTE UNIX Benchmarks - Release 3
  851. X#          Module: multi.sh   SID: 3.4 5/15/91 19:30:24
  852. X#          
  853. X###############################################################################
  854. X# Bug reports, patches, comments, suggestions should be sent to:
  855. X#
  856. X#    Ben Smith or Rick Grehan at BYTE Magazine
  857. X#    ben@bytepb.UUCP    rick_g@bytepb.UUCP
  858. X#
  859. X###############################################################################
  860. X#  Modification Log:
  861. X#
  862. X###############################################################################
  863. ID="@(#)multi.sh:3.4 -- 5/15/91 19:30:24";
  864. for i
  865. do
  866. X    /bin/sh $BINDIR/tst.sh &
  867. done
  868. wait
  869. X
  870. END_OF_FILE
  871. if test 704 -ne `wc -c <'pgms/multi.sh'`; then
  872.     echo shar: \"'pgms/multi.sh'\" unpacked with wrong size!
  873. fi
  874. chmod +x 'pgms/multi.sh'
  875. # end of 'pgms/multi.sh'
  876. fi
  877. if test -f 'pgms/report.awk' -a "${1}" != "-c" ; then 
  878.   echo shar: Will not clobber existing file \"'pgms/report.awk'\"
  879. else
  880. echo shar: Extracting \"'pgms/report.awk'\" \(969 characters\)
  881. sed "s/^X//" >'pgms/report.awk' <<'END_OF_FILE'
  882. X##############################################################################
  883. X#  The BYTE UNIX Benchmarks - Release 1
  884. X#          Module: report.awk   SID: 1.4 5/15/91 19:30:25
  885. X#          
  886. X##############################################################################
  887. X# Bug reports, patches, comments, suggestions should be sent to:
  888. X#
  889. X#    Ben Smith or Tom Yager at BYTE Magazine
  890. X#    ben@bytepb.byte.com   tyager@byptepb.byte.com
  891. X#
  892. X##############################################################################
  893. X# generate an report from test log
  894. X# 
  895. X#############################################################################
  896. X#  Modification Log:
  897. X#        created 4/1/91 - Ben Smith
  898. X#
  899. X##############################################################################
  900. BEGIN { FS="|" ; 
  901. X    printf("\n");
  902. X      }
  903. NF==2        { print $2; }
  904. NF==3        { printf("%-40.40s %s\n",$1,$2); }
  905. NF==6        { printf("%-40.40s %8.1f %-5s (%d secs, %d samples)\n",$1,$5,$3,$2,$6); }
  906. XEND   { printf("\n"); }
  907. END_OF_FILE
  908. if test 969 -ne `wc -c <'pgms/report.awk'`; then
  909.     echo shar: \"'pgms/report.awk'\" unpacked with wrong size!
  910. fi
  911. chmod +x 'pgms/report.awk'
  912. # end of 'pgms/report.awk'
  913. fi
  914. if test -f 'pgms/report.sh' -a "${1}" != "-c" ; then 
  915.   echo shar: Will not clobber existing file \"'pgms/report.sh'\"
  916. else
  917. echo shar: Extracting \"'pgms/report.sh'\" \(1071 characters\)
  918. sed "s/^X//" >'pgms/report.sh' <<'END_OF_FILE'
  919. X##############################################################################
  920. X#  The BYTE UNIX Benchmarks - Release 1
  921. X#          Module: report.sh   SID: 1.4 5/15/91 19:30:26
  922. X#          
  923. X##############################################################################
  924. X# Bug reports, patches, comments, suggestions should be sent to:
  925. X#
  926. X#    Ben Smith or Tom Yager at BYTE Magazine
  927. X#    ben@bytepb.byte.com   tyager@byptepb.byte.com
  928. X#
  929. X##############################################################################
  930. X# generate an report from test log
  931. X# 
  932. X#############################################################################
  933. X#  Modification Log:
  934. X#        created 4/1/91 - Ben Smith
  935. X#
  936. X##############################################################################
  937. BINDIR=${BINDIR-pgms}
  938. TARGET=${TARGET-results/log}
  939. X# RESULTS TARGET
  940. X#
  941. if [ $# -lt 1 ]
  942. then
  943. X    echo "Source File for target machine results: \c"
  944. X    read TARGET
  945. else
  946. X    TARGET=$1
  947. fi
  948. X# check for existance
  949. if [ ! -r ${TARGET} ]
  950. then
  951. X    echo "Cannot open $TARGET for reading"
  952. X    exit 1
  953. fi
  954. awk -f ${BINDIR}/report.awk $TARGET
  955. X
  956. X
  957. END_OF_FILE
  958. if test 1071 -ne `wc -c <'pgms/report.sh'`; then
  959.     echo shar: \"'pgms/report.sh'\" unpacked with wrong size!
  960. fi
  961. chmod +x 'pgms/report.sh'
  962. # end of 'pgms/report.sh'
  963. fi
  964. if test -f 'pgms/tst.sh' -a "${1}" != "-c" ; then 
  965.   echo shar: Will not clobber existing file \"'pgms/tst.sh'\"
  966. else
  967. echo shar: Extracting \"'pgms/tst.sh'\" \(785 characters\)
  968. sed "s/^X//" >'pgms/tst.sh' <<'END_OF_FILE'
  969. X#! /bin/sh
  970. X###############################################################################
  971. X#  The BYTE UNIX Benchmarks - Release 3
  972. X#          Module: tst.sh   SID: 3.4 5/15/91 19:30:24
  973. X#          
  974. X###############################################################################
  975. X# Bug reports, patches, comments, suggestions should be sent to:
  976. X#
  977. X#    Ben Smith or Rick Grehan at BYTE Magazine
  978. X#    ben@bytepb.UUCP    rick_g@bytepb.UUCP
  979. X#
  980. X###############################################################################
  981. X#  Modification Log:
  982. X#
  983. X###############################################################################
  984. ID="@(#)tst.sh:3.4 -- 5/15/91 19:30:24";
  985. sort >sort.$$ <sort.src
  986. od sort.$$ | sort -n +1 > od.$$
  987. grep the sort.$$ | tee grep.$$ | wc > wc.$$
  988. rm sort.$$ grep.$$ od.$$ wc.$$
  989. END_OF_FILE
  990. if test 785 -ne `wc -c <'pgms/tst.sh'`; then
  991.     echo shar: \"'pgms/tst.sh'\" unpacked with wrong size!
  992. fi
  993. chmod +x 'pgms/tst.sh'
  994. # end of 'pgms/tst.sh'
  995. fi
  996. if test ! -d 'results' ; then
  997.     echo shar: Creating directory \"'results'\"
  998.     mkdir 'results'
  999. fi
  1000. if test ! -d 'src' ; then
  1001.     echo shar: Creating directory \"'src'\"
  1002.     mkdir 'src'
  1003. fi
  1004. if test -f 'src/arith.c' -a "${1}" != "-c" ; then 
  1005.   echo shar: Will not clobber existing file \"'src/arith.c'\"
  1006. else
  1007. echo shar: Extracting \"'src/arith.c'\" \(2655 characters\)
  1008. sed "s/^X//" >'src/arith.c' <<'END_OF_FILE'
  1009. X
  1010. X/*******************************************************************************
  1011. X *  The BYTE UNIX Benchmarks - Release 3
  1012. X *          Module: arith.c   SID: 3.3 5/15/91 19:30:19
  1013. X *          
  1014. X *******************************************************************************
  1015. X * Bug reports, patches, comments, suggestions should be sent to:
  1016. X *
  1017. X *    Ben Smith, Rick Grehan or Tom Yager
  1018. X *    ben@bytepb.byte.com   rick_g@bytepb.byte.com   tyager@bytepb.byte.com
  1019. X *
  1020. X *******************************************************************************
  1021. X *  Modification Log:
  1022. X *  May 12, 1989 - modified empty loops to avoid nullifying by optimizing
  1023. X *                 compilers
  1024. X *  August 28, 1990 - changed timing relationship--now returns total number
  1025. X *                      of iterations (ty)
  1026. X *  November 9, 1990 - made changes suggested by Keith Cantrell
  1027. X *                        (digi!kcantrel) to defeat optimization
  1028. X *                        to non-existence
  1029. X *
  1030. X ******************************************************************************/
  1031. X
  1032. char SCCSid[] = "@(#) @(#)arith.c:3.3 -- 5/15/91 19:30:19";
  1033. X/*
  1034. X *  arithmetic test
  1035. X *
  1036. X */
  1037. X
  1038. X#include <stdio.h>
  1039. X#include "timeit.c"
  1040. X
  1041. unsigned long iter;
  1042. X
  1043. X/* this function is called when the alarm expires */
  1044. report()
  1045. X{
  1046. X    fprintf(stderr,"%ld loops\n", iter);
  1047. X    exit(0);
  1048. X}
  1049. X
  1050. main(argc, argv)
  1051. int    argc;
  1052. char    *argv[];
  1053. X{
  1054. X    int    duration;
  1055. X    int result = 0;
  1056. X
  1057. X    if (argc != 2) {
  1058. X        printf("Usage: %s duration\n", argv[0]);
  1059. X        exit(1);
  1060. X    }
  1061. X
  1062. X    duration = atoi(argv[1]);
  1063. X
  1064. X    /* set up alarm call */
  1065. X    iter = 0;    /* init iteration count */
  1066. X    wake_me(duration, report);
  1067. X
  1068. X    /* this loop will be interrupted by the alarm call */
  1069. X    while (1)
  1070. X    {
  1071. X        /* in switching to time-based (instead of iteration-based),
  1072. X           the following statement was added. It should not skew
  1073. X           the timings too much--there was an increment and test
  1074. X           in the "while" expression above. The only difference is 
  1075. X           that now we're incrementing a long instead of an int.  (ty) */
  1076. X    ++iter;
  1077. X    /* the loop calls a function to insure that something is done 
  1078. X       the results of the function are fed back in (just so they 
  1079. X       they won't be thrown away. A loop with 
  1080. X       unused assignments may get optimized out of existence */
  1081. X    result = dumb_stuff(result);
  1082. X    }
  1083. X}
  1084. X
  1085. X
  1086. X/************************** dumb_stuff *******************/
  1087. dumb_stuff(i)
  1088. int i;
  1089. X{
  1090. X#ifndef arithoh
  1091. X    datum    x, y, z;
  1092. X        z = 0;
  1093. X#endif
  1094. X        /*
  1095. X         *     101
  1096. X         * sum       i*i/(i*i-1)
  1097. X         *     i=2
  1098. X         */
  1099. X        /* notice that the i value is always reset by the loop */
  1100. X        for (i=2; i<=101; i++) 
  1101. X            {
  1102. X#ifndef arithoh
  1103. X            x = i;
  1104. X            y = x*x;
  1105. X            z += y/(y-1);
  1106. X            }
  1107. return(x+y+z);
  1108. X#else
  1109. X            }
  1110. return(0);
  1111. X#endif
  1112. X}
  1113. X
  1114. END_OF_FILE
  1115. if test 2655 -ne `wc -c <'src/arith.c'`; then
  1116.     echo shar: \"'src/arith.c'\" unpacked with wrong size!
  1117. fi
  1118. chmod +x 'src/arith.c'
  1119. # end of 'src/arith.c'
  1120. fi
  1121. if test -f 'src/context1.c' -a "${1}" != "-c" ; then 
  1122.   echo shar: Will not clobber existing file \"'src/context1.c'\"
  1123. else
  1124. echo shar: Extracting \"'src/context1.c'\" \(2637 characters\)
  1125. sed "s/^X//" >'src/context1.c' <<'END_OF_FILE'
  1126. X
  1127. X/*******************************************************************************
  1128. X *  The BYTE UNIX Benchmarks - Release 3
  1129. X *          Module: context1.c   SID: 3.3 5/15/91 19:30:18
  1130. X *          
  1131. X *******************************************************************************
  1132. X * Bug reports, patches, comments, suggestions should be sent to:
  1133. X *
  1134. X *    Ben Smith, Rick Grehan or Tom Yager
  1135. X *    ben@bytepb.byte.com   rick_g@bytepb.byte.com   tyager@bytepb.byte.com
  1136. X *
  1137. X *******************************************************************************
  1138. X *  Modification Log:
  1139. X *  $Header: context1.c,v 3.4 87/06/22 14:22:59 kjmcdonell Beta $
  1140. X *  August 28, 1990 - changed timing routines--now returns total number of
  1141. X *                    iterations in specified time period
  1142. X *
  1143. X ******************************************************************************/
  1144. char SCCSid[] = "@(#) @(#)context1.c:3.3 -- 5/15/91 19:30:18";
  1145. X/*
  1146. X *  Context switching via synchronized unbuffered pipe i/o
  1147. X *
  1148. X */
  1149. X
  1150. X#include <stdio.h>
  1151. X#include "timeit.c"
  1152. X#include <errno.h>
  1153. X
  1154. unsigned long iter;
  1155. X
  1156. report()
  1157. X{
  1158. X    fprintf(stderr,"%ld loops\n", iter);
  1159. X    exit(0);
  1160. X}
  1161. X
  1162. main(argc, argv)
  1163. int    argc;
  1164. char    *argv[];
  1165. X{
  1166. X    int duration;
  1167. X    int    check;
  1168. X    int    p1[2], p2[2];
  1169. X
  1170. X    if (argc != 2) {
  1171. X        printf("Usage: context duration\n");
  1172. X        exit(1);
  1173. X    }
  1174. X
  1175. X    duration = atoi(argv[1]);
  1176. X    
  1177. X    /* set up alarm call */
  1178. X    iter = 0;
  1179. X    wake_me(duration, report);
  1180. X
  1181. X    if (pipe(p1) || pipe(p2)) {
  1182. X        perror("pipe create failed");
  1183. X        exit(1);
  1184. X    }
  1185. X
  1186. X    if (fork()) {    /* parent process */
  1187. X        /* master, write p1 & read p2 */
  1188. X        close(p1[0]); close(p2[1]);
  1189. X        while (1) {
  1190. X            if (write(p1[1], (char *)&iter, sizeof(iter)) != sizeof(iter)) {
  1191. X                if ((errno != 0) && (errno != EINTR))
  1192. X                    perror("master write failed");
  1193. X                exit(1);
  1194. X            }
  1195. X            if (read(p2[0], (char *)&check, sizeof(check)) != sizeof(check)) {
  1196. X                if ((errno != 0) && (errno != EINTR))
  1197. X                    perror("master read failed");
  1198. X                exit(1);
  1199. X            }
  1200. X            if (check != iter) {
  1201. X                printf("Master sync error: expect %d, got %d\n",
  1202. X                    iter, check);
  1203. X                exit(2);
  1204. X            }
  1205. X            iter++;
  1206. X        }
  1207. X    }
  1208. X    else { /* child process */
  1209. X        unsigned long iter1;
  1210. X
  1211. X        iter1 = 0;
  1212. X        /* slave, read p1 & write p2 */
  1213. X        close(p1[1]); close(p2[0]);
  1214. X        while (1) {
  1215. X            if (read(p1[0], (char *)&check, sizeof(check)) != sizeof(check)) {
  1216. X                if ((errno != 0) && (errno != EINTR))
  1217. X                    perror("slave read failed");
  1218. X                exit(1);
  1219. X            }
  1220. X            if (check != iter1) {
  1221. X                printf("Slave sync error: expect %d, got %d\n",
  1222. X                    iter, check);
  1223. X                exit(2);
  1224. X            }
  1225. X            if (write(p2[1], (char *)&iter1, sizeof(iter1)) != sizeof(check)) {
  1226. X                if ((errno != 0) && (errno != EINTR))
  1227. X                    perror("slave write failed");
  1228. X                exit(1);
  1229. X            }
  1230. X            iter1++;
  1231. X        }
  1232. X    }
  1233. X}
  1234. END_OF_FILE
  1235. if test 2637 -ne `wc -c <'src/context1.c'`; then
  1236.     echo shar: \"'src/context1.c'\" unpacked with wrong size!
  1237. fi
  1238. chmod +x 'src/context1.c'
  1239. # end of 'src/context1.c'
  1240. fi
  1241. if test -f 'src/execl.c' -a "${1}" != "-c" ; then 
  1242.   echo shar: Will not clobber existing file \"'src/execl.c'\"
  1243. else
  1244. echo shar: Extracting \"'src/execl.c'\" \(2379 characters\)
  1245. sed "s/^X//" >'src/execl.c' <<'END_OF_FILE'
  1246. X/*******************************************************************************
  1247. X *  The BYTE UNIX Benchmarks - Release 3
  1248. X *          Module: execl.c   SID: 3.3 5/15/91 19:30:19
  1249. X *          
  1250. X *******************************************************************************
  1251. X * Bug reports, patches, comments, suggestions should be sent to:
  1252. X *
  1253. X *    Ben Smith, Rick Grehan or Tom Yager
  1254. X *    ben@bytepb.byte.com   rick_g@bytepb.byte.com   tyager@bytepb.byte.com
  1255. X *
  1256. X *******************************************************************************
  1257. X *  Modification Log:
  1258. X *  $Header: execl.c,v 3.5 87/06/22 15:37:08 kjmcdonell Beta $
  1259. X *  August 28, 1990 - Modified timing routines
  1260. X *
  1261. X ******************************************************************************/
  1262. X/*
  1263. X *  Execing
  1264. X *
  1265. X */
  1266. char SCCSid[] = "@(#) @(#)execl.c:3.3 -- 5/15/91 19:30:19";
  1267. X
  1268. X#include <stdio.h>
  1269. X#include <sys/types.h>
  1270. X
  1271. char    bss[8*1024];    /* something worthwhile */
  1272. X
  1273. X#define main dummy
  1274. X            
  1275. X#include "big.c"        /* some real code */
  1276. X
  1277. X#undef main
  1278. X
  1279. X/* added by BYTE */
  1280. char *getenv();
  1281. X
  1282. X
  1283. main(argc, argv)    /* the real program */
  1284. int    argc;
  1285. char    *argv[];
  1286. X{
  1287. X        unsigned long iter = 0;
  1288. X    char *ptr; 
  1289. X    char *fullpath;
  1290. X    int     duration;
  1291. X    char    count_str[6], start_str[12], path_str[81], *dur_str;
  1292. X    long    start_time, this_time;
  1293. X
  1294. X#ifdef DEBUG
  1295. X    int count;
  1296. X    for(count = 0; count < argc; ++ count)
  1297. X        printf("%s ",argv[count]);
  1298. X        printf("\n");
  1299. X#endif
  1300. X    if (argc < 2) 
  1301. X        {
  1302. X        printf("Usage: %s duration\n", argv[0]);
  1303. X        exit(1);
  1304. X        }
  1305. X
  1306. X
  1307. X    duration = atoi(argv[1]);
  1308. X    if (duration > 0) 
  1309. X        /* the first invocation */
  1310. X        {  
  1311. X        dur_str = argv[1];
  1312. X        if((ptr = getenv("BINDIR")) != NULL)
  1313. X            sprintf(path_str,"%s/execl",ptr);
  1314. X        fullpath=path_str;
  1315. X        time(&start_time);
  1316. X        }
  1317. X    else  /* one of those execl'd invocations */
  1318. X        {
  1319. X        /* real duration follow the phoney null duration */
  1320. X        duration = atoi(argv[2]);
  1321. X        dur_str = argv[2];
  1322. X        iter = (unsigned long)atoi(argv[3]); /* where are we now ? */
  1323. X        sscanf(argv[4], "%ld", &start_time);
  1324. X        fullpath = argv[0];
  1325. X        } 
  1326. X
  1327. X    sprintf(count_str, "%d", ++iter); /* increment the execl counter */
  1328. X    sprintf(start_str, "%ld", start_time);
  1329. X    time(&this_time);
  1330. X    if (this_time - start_time >= duration) { /* time has run out */
  1331. X        fprintf(stderr, "%ld loops\n", iter);
  1332. X        exit(0);
  1333. X        }
  1334. X    execl(fullpath, fullpath, "0", dur_str, count_str, start_str, 0);
  1335. X    printf("Exec failed at iteration %d\n", iter);
  1336. X    perror("Reason");
  1337. X    exit(1);
  1338. X}
  1339. END_OF_FILE
  1340. if test 2379 -ne `wc -c <'src/execl.c'`; then
  1341.     echo shar: \"'src/execl.c'\" unpacked with wrong size!
  1342. fi
  1343. chmod +x 'src/execl.c'
  1344. # end of 'src/execl.c'
  1345. fi
  1346. if test -f 'src/getopt.c' -a "${1}" != "-c" ; then 
  1347.   echo shar: Will not clobber existing file \"'src/getopt.c'\"
  1348. else
  1349. echo shar: Extracting \"'src/getopt.c'\" \(3147 characters\)
  1350. sed "s/^X//" >'src/getopt.c' <<'END_OF_FILE'
  1351. X/*******************************************************************************
  1352. X *  The BYTE UNIX Benchmarks - Release 3
  1353. X *          Module: getopt.c   SID: 3.3 5/15/91 19:30:18
  1354. X *          
  1355. X *******************************************************************************
  1356. X * Bug reports, patches, comments, suggestions should be sent to:
  1357. X *
  1358. X *    Ben Smith, Rick Grehan or Tom Yager
  1359. X *    ben@bytepb.byte.com   rick_g@bytepb.byte.com   tyager@bytepb.byte.com
  1360. X *
  1361. X *******************************************************************************
  1362. X *  Modification Log:
  1363. X *    @(#)getopt.c    2.5 (smail) 9/15/87
  1364. X * Here's something you've all been waiting for:  the AT&T public domain
  1365. X * source for getopt(3).  It is the code which was given out at the 1985
  1366. X * UNIFORUM conference in Dallas.  I obtained it by electronic mail
  1367. X * directly from AT&T.  The people there assure me that it is indeed
  1368. X * in the public domain.
  1369. X * 
  1370. X * There is no manual page.  That is because the one they gave out at
  1371. X * UNIFORUM was slightly different from the current System V Release 2
  1372. X * manual page.  The difference apparently involved a note about the
  1373. X * famous rules 5 and 6, recommending using white space between an option
  1374. X * and its first argument, and not grouping options that have arguments.
  1375. X * Getopt itself is currently lenient about both of these things White
  1376. X * space is allowed, but not mandatory, and the last option in a group can
  1377. X * have an argument.  That particular version of the man page evidently
  1378. X * has no official existence, and my source at AT&T did not send a copy.
  1379. X * The current SVR2 man page reflects the actual behavor of this getopt.
  1380. X * However, I am not about to post a copy of anything licensed by AT&T.
  1381. X *********************************************************************/
  1382. char SCCSid[] = "@(#) @(#)getopt.c:3.3 -- 5/15/91 19:30:18";
  1383. X
  1384. X/* This include is needed only to get "index" defined as "strchr" on Sys V. */
  1385. X#include "defs.h"
  1386. X
  1387. X/*LINTLIBRARY*/
  1388. X#define NULL    0
  1389. X#define EOF    (-1)
  1390. X#define ERR(s, c)    if(opterr){\
  1391. X    extern int write();\
  1392. X    char errbuf[2];\
  1393. X    errbuf[0] = c; errbuf[1] = '\n';\
  1394. X    (void) write(2, argv[0], (unsigned)strlen(argv[0]));\
  1395. X    (void) write(2, s, (unsigned)strlen(s));\
  1396. X    (void) write(2, errbuf, 2);}
  1397. X
  1398. extern char *index();
  1399. X
  1400. int    opterr = 1;
  1401. int    optind = 1;
  1402. int    optopt;
  1403. char    *optarg;
  1404. X
  1405. int
  1406. getopt(argc, argv, opts)
  1407. int    argc;
  1408. char    **argv, *opts;
  1409. X{
  1410. X    static int sp = 1;
  1411. X    register int c;
  1412. X    register char *cp;
  1413. X
  1414. X    if(sp == 1)
  1415. X        if(optind >= argc ||
  1416. X           argv[optind][0] != '-' || argv[optind][1] == '\0')
  1417. X            return(EOF);
  1418. X        else if(strcmp(argv[optind], "--") == NULL) {
  1419. X            optind++;
  1420. X            return(EOF);
  1421. X        }
  1422. X    optopt = c = argv[optind][sp];
  1423. X    if(c == ':' || (cp=index(opts, c)) == NULL) {
  1424. X        ERR(": illegal option -- ", c);
  1425. X        if(argv[optind][++sp] == '\0') {
  1426. X            optind++;
  1427. X            sp = 1;
  1428. X        }
  1429. X        return('?');
  1430. X    }
  1431. X    if(*++cp == ':') {
  1432. X        if(argv[optind][sp+1] != '\0')
  1433. X            optarg = &argv[optind++][sp+1];
  1434. X        else if(++optind >= argc) {
  1435. X            ERR(": option requires an argument -- ", c);
  1436. X            sp = 1;
  1437. X            return('?');
  1438. X        } else
  1439. X            optarg = argv[optind++];
  1440. X        sp = 1;
  1441. X    } else {
  1442. X        if(argv[optind][++sp] == '\0') {
  1443. X            sp = 1;
  1444. X            optind++;
  1445. X        }
  1446. X        optarg = NULL;
  1447. X    }
  1448. X    return(c);
  1449. X}
  1450. END_OF_FILE
  1451. if test 3147 -ne `wc -c <'src/getopt.c'`; then
  1452.     echo shar: \"'src/getopt.c'\" unpacked with wrong size!
  1453. fi
  1454. chmod +x 'src/getopt.c'
  1455. # end of 'src/getopt.c'
  1456. fi
  1457. if test -f 'src/hanoi.c' -a "${1}" != "-c" ; then 
  1458.   echo shar: Will not clobber existing file \"'src/hanoi.c'\"
  1459. else
  1460. echo shar: Extracting \"'src/hanoi.c'\" \(1479 characters\)
  1461. sed "s/^X//" >'src/hanoi.c' <<'END_OF_FILE'
  1462. X/*******************************************************************************
  1463. X *  The BYTE UNIX Benchmarks - Release 3
  1464. X *          Module: hanoi.c   SID: 3.3 5/15/91 19:30:20
  1465. X *          
  1466. X *******************************************************************************
  1467. X * Bug reports, patches, comments, suggestions should be sent to:
  1468. X *
  1469. X *    Ben Smith, Rick Grehan or Tom Yager
  1470. X *    ben@bytepb.byte.com   rick_g@bytepb.byte.com   tyager@bytepb.byte.com
  1471. X *
  1472. X *******************************************************************************
  1473. X *  Modification Log:
  1474. X *  $Header: hanoi.c,v 3.5 87/08/06 08:11:14 kenj Exp $
  1475. X *  August 28, 1990 - Modified timing routines (ty)
  1476. X *
  1477. X ******************************************************************************/
  1478. char SCCSid[] = "@(#) @(#)hanoi.c:3.3 -- 5/15/91 19:30:20";
  1479. X
  1480. X#define other(i,j) (6-(i+j))
  1481. X
  1482. X#include <stdio.h>
  1483. X#include "timeit.c"
  1484. X
  1485. unsigned long iter = 0;
  1486. int num[4];
  1487. long cnt;
  1488. X
  1489. report()
  1490. X{
  1491. X    fprintf(stderr,"%ld loops\n", iter);
  1492. X    exit(0);
  1493. X}
  1494. X
  1495. X
  1496. main(argc,argv)
  1497. char **argv;
  1498. X{
  1499. X    int disk=10, /* default number of disks */
  1500. X         duration;
  1501. X
  1502. X    if (argc < 2) {
  1503. X        printf("Usage: %s duration [disks]\n", argv[0]);
  1504. X        exit(1);
  1505. X        }
  1506. X    duration = atoi(argv[1]);
  1507. X    if(argc > 2) disk = atoi(argv[2]);
  1508. X    num[1] = disk;
  1509. X
  1510. X    wake_me(duration, report);
  1511. X
  1512. X    while(1) {
  1513. X        mov(disk,1,3);
  1514. X        iter++;
  1515. X        }
  1516. X
  1517. X    exit(0);
  1518. X}
  1519. X
  1520. mov(n,f,t)
  1521. X{
  1522. X    int o;
  1523. X    if(n == 1) {
  1524. X        num[f]--;
  1525. X        num[t]++;
  1526. X        return;
  1527. X    }
  1528. X    o = other(f,t);
  1529. X    mov(n-1,f,o);
  1530. X    mov(1,f,t);
  1531. X    mov(n-1,o,t);
  1532. X    return;
  1533. X}
  1534. END_OF_FILE
  1535. if test 1479 -ne `wc -c <'src/hanoi.c'`; then
  1536.     echo shar: \"'src/hanoi.c'\" unpacked with wrong size!
  1537. fi
  1538. chmod +x 'src/hanoi.c'
  1539. # end of 'src/hanoi.c'
  1540. fi
  1541. if test -f 'src/limit.c' -a "${1}" != "-c" ; then 
  1542.   echo shar: Will not clobber existing file \"'src/limit.c'\"
  1543. else
  1544. echo shar: Extracting \"'src/limit.c'\" \(3291 characters\)
  1545. sed "s/^X//" >'src/limit.c' <<'END_OF_FILE'
  1546. X/*******************************************************************************
  1547. X *  The BYTE UNIX Benchmarks - Release 3
  1548. X *          Module: limit.c   SID: 3.3 5/15/91 19:30:20
  1549. X *          
  1550. X *******************************************************************************
  1551. X * Bug reports, patches, comments, suggestions should be sent to:
  1552. X *
  1553. X *    Ben Smith, Rick Grehan or Tom Yager
  1554. X *    ben@bytepb.byte.com   rick_g@bytepb.byte.com   tyager@bytepb.byte.com
  1555. X *
  1556. X *******************************************************************************
  1557. X *  Modification Log:
  1558. X *  $Header: limit.c,v 3.4 87/06/22 14:25:11 kjmcdonell Beta $
  1559. X *
  1560. X ******************************************************************************/
  1561. X/*
  1562. X *  Force a UNIX system to the per process and per user limits
  1563. X *
  1564. X */
  1565. char SCCSid[] = "@(#) @(#)limit.c:3.3 -- 5/15/91 19:30:20";
  1566. X
  1567. X#define    CLICK    1024
  1568. X#define    MAXCHN    100
  1569. X
  1570. X#include <signal.h>
  1571. X#include <setjmp.h>
  1572. X
  1573. int    parent;        /* parent's pid */
  1574. int    child;        /* child's pid */
  1575. int    pid[MAXCHN];
  1576. int    ncall;
  1577. int    level;
  1578. jmp_buf    env;
  1579. X
  1580. main(argc, argv)
  1581. int    argc;
  1582. char    *argv[];
  1583. X{
  1584. X    char    *top;
  1585. X    int    pad;
  1586. X    int    end;
  1587. X    int    i;
  1588. X    int    status;
  1589. X    float    f;
  1590. X    int    flag();
  1591. X    int    wakeup();
  1592. X    long    last;
  1593. X
  1594. X    /* open files (file descriptors) */
  1595. X    for (i = 3; open(".", 0) > 0; i++) ;
  1596. X    printf("Maximum open files per process: %d\n", i);
  1597. X    while (--i > 2)
  1598. X        close(i);
  1599. X
  1600. X    /* process address space */
  1601. X    top = (char *)sbrk(0);
  1602. X#if debug
  1603. X    printf("inital top of program: 0x%x\n", top);
  1604. X#endif
  1605. X    pad = (((int)top+CLICK-1)/CLICK)*CLICK - (int)top;
  1606. X    sbrk(pad);
  1607. X    for (i = 0; (char *)sbrk(CLICK) != (char *)-1; i++) ;
  1608. X#if debug
  1609. X    printf("final top of program: 0x%x\n", sbrk(0));
  1610. X#endif
  1611. X    brk(top);
  1612. X#if debug
  1613. X    printf("top of program restored to: 0x%x\n", sbrk(0));
  1614. X#endif
  1615. X    end = (((int)top+pad)/CLICK) + i;
  1616. X    f = ((float)end * CLICK) / 1024;
  1617. X    printf("Process address space limit: ");
  1618. X    if (f < 1024)
  1619. X        printf("%.2f Kbytes\n", f);
  1620. X    else {
  1621. X        f /= 1024;
  1622. X        printf("%.2f Mbytes\n", f);
  1623. X    }
  1624. X
  1625. X    /* process creations */
  1626. X    printf("Maximum number of child processes:");
  1627. X    i = 0;
  1628. X    while (1) {
  1629. X#if debug
  1630. X        printf("about to fork\n");
  1631. X#endif
  1632. X        if ((pid[i] = fork()) == -1) {
  1633. X#if debug
  1634. X            perror("fork failed");
  1635. X#endif
  1636. X            break;
  1637. X        } else if (pid[i] != 0) {
  1638. X#if debug
  1639. X            printf("child %d: pid=%d\n", i+1, pid[i]);
  1640. X#endif
  1641. X            i++;
  1642. X            if (i >= MAXCHN) {
  1643. X                printf(" more than");
  1644. X                break;
  1645. X            }
  1646. X        } else {
  1647. X#if debug
  1648. X            printf("child %d pausing\n", getpid());
  1649. X#endif
  1650. X            pause();
  1651. X#if debug
  1652. X            printf("child %d exiting\n", getpid());
  1653. X#endif
  1654. X            exit(1);
  1655. X        }
  1656. X    }
  1657. X    printf(" %d\n", i);
  1658. X    while (--i >= 0) {
  1659. X        kill(pid[i], SIGKILL);
  1660. X        wait(0);
  1661. X    }
  1662. X
  1663. X    ncall = level = 0;
  1664. X    parent = getpid();
  1665. X    signal(SIGTERM, flag);
  1666. X    if ((child = fork()) == 0) {
  1667. X        signal(SIGALRM, wakeup);
  1668. X        recurse();
  1669. X        exit(4);
  1670. X    }
  1671. X    while ((i = wait(&status)) == -1) {
  1672. X    }
  1673. X    printf("Estimated maximum stack size: %d Kbytes\n", level);
  1674. X    exit(0);
  1675. X}
  1676. X
  1677. recurse()
  1678. X{
  1679. X    int    temp[1024 / sizeof(int)];
  1680. X#if debug
  1681. X    printf("recursion @ level %d\n", ncall);
  1682. X#endif
  1683. X    temp[1024 / sizeof(int) - 1] = 1;
  1684. X    ncall++;
  1685. X    kill(parent, SIGTERM);
  1686. X    while (ncall > level) {
  1687. X        alarm(2);
  1688. X        pause();
  1689. X    }
  1690. X    if (ncall < 8000)
  1691. X        /* less than 8M bytes of temp storage! */
  1692. X        recurse();
  1693. X    else
  1694. X        /* give up! */
  1695. X        exit(0);
  1696. X}
  1697. X
  1698. flag()
  1699. X{
  1700. X    signal(SIGTERM, flag);
  1701. X    level++;
  1702. X    if (child != 0)
  1703. X        kill(child, SIGTERM);
  1704. X}
  1705. X
  1706. wakeup()
  1707. X{
  1708. X    signal(SIGALRM, wakeup);
  1709. X}
  1710. END_OF_FILE
  1711. if test 3291 -ne `wc -c <'src/limit.c'`; then
  1712.     echo shar: \"'src/limit.c'\" unpacked with wrong size!
  1713. fi
  1714. chmod +x 'src/limit.c'
  1715. # end of 'src/limit.c'
  1716. fi
  1717. if test -f 'src/looper.c' -a "${1}" != "-c" ; then 
  1718.   echo shar: Will not clobber existing file \"'src/looper.c'\"
  1719. else
  1720. echo shar: Extracting \"'src/looper.c'\" \(1985 characters\)
  1721. sed "s/^X//" >'src/looper.c' <<'END_OF_FILE'
  1722. X/*******************************************************************************
  1723. X *  The BYTE UNIX Benchmarks - Release 1
  1724. X *          Module: looper.c   SID: 1.4 5/15/91 19:30:22
  1725. X *          
  1726. X *******************************************************************************
  1727. X * Bug reports, patches, comments, suggestions should be sent to:
  1728. X *
  1729. X *    Ben Smith or Tom Yager at BYTE Magazine
  1730. X *    ben@bytepb.byte.com   tyager@bytepb.byte.com
  1731. X *
  1732. X *******************************************************************************
  1733. X *  Modification Log:
  1734. X *  
  1735. X *  February 25, 1991 -- created (Ben S.)
  1736. X *
  1737. X ******************************************************************************/
  1738. char SCCSid[] = "@(#) @(#)looper.c:1.4 -- 5/15/91 19:30:22";
  1739. X/*
  1740. X *  Shell Process creation
  1741. X *
  1742. X */
  1743. X
  1744. X#include <stdio.h>
  1745. X#include "timeit.c"
  1746. X
  1747. unsigned long iter;
  1748. char *cmd_argv[28];
  1749. int  cmd_argc;
  1750. X
  1751. report()
  1752. X{
  1753. X    fprintf(stderr,"%ld loops\n", iter);
  1754. X    exit(0);
  1755. X}
  1756. X
  1757. main(argc, argv, env)
  1758. int    argc;
  1759. char    *argv[];
  1760. char    *env[];
  1761. X{
  1762. int    slave, count, count1, duration;
  1763. int    status;
  1764. X
  1765. if (argc < 2) 
  1766. X    {
  1767. X    printf("Usage: %s duration command [args..]\n", argv[0]);
  1768. X    printf("  duration in seconds\n");
  1769. X    exit(1);
  1770. X    }
  1771. X
  1772. if((duration = atoi(argv[1])) < 1)
  1773. X    {
  1774. X    printf("Usage: %s duration command [arg..]\n", argv[0]);
  1775. X    printf("  duration in seconds\n");
  1776. X    exit(1);
  1777. X    }
  1778. X
  1779. X/* get command  */
  1780. cmd_argc=argc-2;
  1781. for( count=2;count < argc; ++count)
  1782. X    cmd_argv[count-2]=argv[count];
  1783. X#ifdef DEBUG
  1784. printf("<<%s>>",cmd_argv[0]);
  1785. for(count=1;count < cmd_argc; ++count)
  1786. X    printf(" <%s>", cmd_argv[count]);
  1787. putchar('\n');
  1788. exit(0);
  1789. X#endif
  1790. X
  1791. iter = 0;
  1792. wake_me(duration, report);
  1793. X
  1794. while (1) 
  1795. X    {
  1796. X    if ((slave = fork()) == 0) 
  1797. X        { /* execute command */
  1798. X        execvp(cmd_argv[0],cmd_argv);
  1799. X        exit(0);
  1800. X        } 
  1801. X    else if (slave < 0) 
  1802. X        {
  1803. X        /* woops ... */
  1804. X        printf("Fork failed at iteration %d\n", iter);
  1805. X        perror("Reason");
  1806. X        exit(2);
  1807. X        } 
  1808. X    else
  1809. X        /* master */
  1810. X        wait(&status);
  1811. X    if (status != 0) 
  1812. X        {
  1813. X        printf("Bad wait status: 0x%x\n", status);
  1814. X        exit(2);
  1815. X        }
  1816. X    iter++;
  1817. X    }
  1818. X}
  1819. END_OF_FILE
  1820. if test 1985 -ne `wc -c <'src/looper.c'`; then
  1821.     echo shar: \"'src/looper.c'\" unpacked with wrong size!
  1822. fi
  1823. chmod +x 'src/looper.c'
  1824. # end of 'src/looper.c'
  1825. fi
  1826. if test -f 'src/pipe.c' -a "${1}" != "-c" ; then 
  1827.   echo shar: Will not clobber existing file \"'src/pipe.c'\"
  1828. else
  1829. echo shar: Extracting \"'src/pipe.c'\" \(1610 characters\)
  1830. sed "s/^X//" >'src/pipe.c' <<'END_OF_FILE'
  1831. X/*******************************************************************************
  1832. X *  The BYTE UNIX Benchmarks - Release 3
  1833. X *          Module: pipe.c   SID: 3.3 5/15/91 19:30:20
  1834. X *          
  1835. X *******************************************************************************
  1836. X * Bug reports, patches, comments, suggestions should be sent to:
  1837. X *
  1838. X *    Ben Smith, Rick Grehan or Tom Yager
  1839. X *    ben@bytepb.byte.com   rick_g@bytepb.byte.com   tyager@bytepb.byte.com
  1840. X *
  1841. X *******************************************************************************
  1842. X *  Modification Log:
  1843. X *  $Header: pipe.c,v 3.5 87/06/22 14:32:36 kjmcdonell Beta $
  1844. X *  August 29, 1990 - modified timing routines (ty)
  1845. X *
  1846. X ******************************************************************************/
  1847. char SCCSid[] = "@(#) @(#)pipe.c:3.3 -- 5/15/91 19:30:20";
  1848. X/*
  1849. X *  pipe  -- test single process pipe throughput (no context switching)
  1850. X *
  1851. X */
  1852. X
  1853. X#include <stdio.h>
  1854. X#include <errno.h>
  1855. X#include "timeit.c"
  1856. X
  1857. unsigned long iter;
  1858. X
  1859. report()
  1860. X{
  1861. X    fprintf(stderr,"%ld loops\n", iter);
  1862. X    exit(0);
  1863. X}
  1864. X
  1865. main(argc, argv)
  1866. int    argc;
  1867. char    *argv[];
  1868. X{
  1869. X    char    buf[512];
  1870. X    int        pvec[2], duration;
  1871. X
  1872. X    if (argc != 2) {
  1873. X        printf("Usage: %s duration\n", argv[0]);
  1874. X        exit(1);
  1875. X        }
  1876. X
  1877. X    duration = atoi(argv[1]);
  1878. X
  1879. X    pipe(pvec);
  1880. X
  1881. X    wake_me(duration, report);
  1882. X    iter = 0;
  1883. X
  1884. X    while (1) {
  1885. X        if (write(pvec[1], buf, sizeof(buf)) != sizeof(buf)) {
  1886. X            if ((errno != EINTR) && (errno != 0))
  1887. X                printf("write failed, error %d\n", errno);
  1888. X            }
  1889. X        if (read(pvec[0], buf, sizeof(buf)) != sizeof(buf)) {
  1890. X            if ((errno != EINTR) && (errno != 0))
  1891. X                printf("read failed, error %d\n", errno);
  1892. X            }
  1893. X        iter++;
  1894. X    }
  1895. X}
  1896. END_OF_FILE
  1897. if test 1610 -ne `wc -c <'src/pipe.c'`; then
  1898.     echo shar: \"'src/pipe.c'\" unpacked with wrong size!
  1899. fi
  1900. chmod +x 'src/pipe.c'
  1901. # end of 'src/pipe.c'
  1902. fi
  1903. if test -f 'src/spawn.c' -a "${1}" != "-c" ; then 
  1904.   echo shar: Will not clobber existing file \"'src/spawn.c'\"
  1905. else
  1906. echo shar: Extracting \"'src/spawn.c'\" \(1702 characters\)
  1907. sed "s/^X//" >'src/spawn.c' <<'END_OF_FILE'
  1908. X/*******************************************************************************
  1909. X *  The BYTE UNIX Benchmarks - Release 3
  1910. X *          Module: spawn.c   SID: 3.3 5/15/91 19:30:20
  1911. X *          
  1912. X *******************************************************************************
  1913. X * Bug reports, patches, comments, suggestions should be sent to:
  1914. X *
  1915. X *    Ben Smith, Rick Grehan or Tom Yagerat BYTE Magazine
  1916. X *    ben@bytepb.byte.com   rick_g@bytepb.byte.com   tyager@bytepb.byte.com
  1917. X *
  1918. X *******************************************************************************
  1919. X *  Modification Log:
  1920. X *  $Header: spawn.c,v 3.4 87/06/22 14:32:48 kjmcdonell Beta $
  1921. X *  August 29, 1990 - Modified timing routines (ty)
  1922. X *
  1923. X ******************************************************************************/
  1924. char SCCSid[] = "@(#) @(#)spawn.c:3.3 -- 5/15/91 19:30:20";
  1925. X/*
  1926. X *  Process creation
  1927. X *
  1928. X */
  1929. X
  1930. X#include <stdio.h>
  1931. X#include "timeit.c"
  1932. X
  1933. unsigned long iter;
  1934. X
  1935. report()
  1936. X{
  1937. X    fprintf(stderr,"%ld loops\n", iter);
  1938. X    exit(0);
  1939. X}
  1940. X
  1941. main(argc, argv)
  1942. int    argc;
  1943. char    *argv[];
  1944. X{
  1945. X    int    slave, count, count1, duration;
  1946. X    int    status;
  1947. X
  1948. X    if (argc != 2) {
  1949. X        printf("Usage: %s duration \n", argv[0]);
  1950. X        exit(1);
  1951. X    }
  1952. X
  1953. X    duration = atoi(argv[1]);
  1954. X
  1955. X    iter = 0;
  1956. X    wake_me(duration, report);
  1957. X
  1958. X    while (1) {
  1959. X        if ((slave = fork()) == 0) {
  1960. X            /* slave .. boring */
  1961. X#if debug
  1962. X            printf("fork OK\n");
  1963. X#endif
  1964. X            /* kill it right away */
  1965. X            exit(0);
  1966. X        } else if (slave < 0) {
  1967. X            /* woops ... */
  1968. X            printf("Fork failed at iteration %d\n", iter);
  1969. X            perror("Reason");
  1970. X            exit(2);
  1971. X        } else
  1972. X            /* master */
  1973. X            wait(&status);
  1974. X        if (status != 0) {
  1975. X            printf("Bad wait status: 0x%x\n", status);
  1976. X            exit(2);
  1977. X        }
  1978. X        iter++;
  1979. X#if debug
  1980. X        printf("Child %d done.\n", slave);
  1981. X#endif
  1982. X        }
  1983. X}
  1984. END_OF_FILE
  1985. if test 1702 -ne `wc -c <'src/spawn.c'`; then
  1986.     echo shar: \"'src/spawn.c'\" unpacked with wrong size!
  1987. fi
  1988. chmod +x 'src/spawn.c'
  1989. # end of 'src/spawn.c'
  1990. fi
  1991. if test -f 'src/syscall.c' -a "${1}" != "-c" ; then 
  1992.   echo shar: Will not clobber existing file \"'src/syscall.c'\"
  1993. else
  1994. echo shar: Extracting \"'src/syscall.c'\" \(1313 characters\)
  1995. sed "s/^X//" >'src/syscall.c' <<'END_OF_FILE'
  1996. X/*******************************************************************************
  1997. X *  The BYTE UNIX Benchmarks - Release 3
  1998. X *          Module: syscall.c   SID: 3.3 5/15/91 19:30:21
  1999. X *          
  2000. X *******************************************************************************
  2001. X * Bug reports, patches, comments, suggestions should be sent to:
  2002. X *
  2003. X *    Ben Smith, Rick Grehan or Tom Yager at BYTE Magazine
  2004. X *    ben@bytepb.byte.com   rick_g@bytepb.byte.com   tyager@bytepb.byte.com
  2005. X *
  2006. X *******************************************************************************
  2007. X *  Modification Log:
  2008. X *  $Header: syscall.c,v 3.4 87/06/22 14:32:54 kjmcdonell Beta $
  2009. X *  August 29, 1990 - Modified timing routines
  2010. X *
  2011. X ******************************************************************************/
  2012. X/*
  2013. X *  syscall  -- sit in a loop calling the system
  2014. X *
  2015. X */
  2016. char SCCSid[] = "@(#) @(#)syscall.c:3.3 -- 5/15/91 19:30:21";
  2017. X
  2018. X#include <stdio.h>
  2019. X#include "timeit.c"
  2020. X
  2021. unsigned long iter;
  2022. X
  2023. report()
  2024. X{
  2025. X    fprintf(stderr,"%ld loops\n", iter);
  2026. X    exit(0);
  2027. X}
  2028. X
  2029. main(argc, argv)
  2030. int    argc;
  2031. char    *argv[];
  2032. X{
  2033. X    int    duration;
  2034. X    int    i;
  2035. X
  2036. X    if (argc != 2) {
  2037. X        printf("Usage: %s duration\n", argv[0]);
  2038. X        exit(1);
  2039. X    }
  2040. X
  2041. X    duration = atoi(argv[1]);
  2042. X
  2043. X    iter = 0;
  2044. X    wake_me(duration, report);
  2045. X
  2046. X    while (1) {
  2047. X        close(dup(0));
  2048. X        getpid();
  2049. X        getuid();
  2050. X        umask(022);
  2051. X        iter++;
  2052. X    }
  2053. X}
  2054. END_OF_FILE
  2055. if test 1313 -ne `wc -c <'src/syscall.c'`; then
  2056.     echo shar: \"'src/syscall.c'\" unpacked with wrong size!
  2057. fi
  2058. chmod +x 'src/syscall.c'
  2059. # end of 'src/syscall.c'
  2060. fi
  2061. if test -f 'src/timeit.c' -a "${1}" != "-c" ; then 
  2062.   echo shar: Will not clobber existing file \"'src/timeit.c'\"
  2063. else
  2064. echo shar: Extracting \"'src/timeit.c'\" \(1145 characters\)
  2065. sed "s/^X//" >'src/timeit.c' <<'END_OF_FILE'
  2066. X/*******************************************************************************
  2067. X *          
  2068. X *  The BYTE UNIX Benchmarks - Release 3
  2069. X *          Module: timeit.c   SID: 3.3 5/15/91 19:30:21
  2070. X *******************************************************************************
  2071. X * Bug reports, patches, comments, suggestions should be sent to:
  2072. X *
  2073. X *    Ben Smith, Rick Grehan or Tom Yager
  2074. X *    ben@bytepb.byte.com   rick_g@bytepb.byte.com   tyager@bytepb.byte.com
  2075. X *
  2076. X *******************************************************************************
  2077. X *  Modification Log:
  2078. X *  May 12, 1989 - modified empty loops to avoid nullifying by optimizing
  2079. X *                 compilers
  2080. X *  August 28, 1990 - changed timing relationship--now returns total number
  2081. X *                      of iterations (ty)
  2082. X *
  2083. X ******************************************************************************/
  2084. X
  2085. X/* this module is #included in other modules--no separate SCCS ID */
  2086. X
  2087. X/*
  2088. X *  Timing routine
  2089. X *
  2090. X */
  2091. X
  2092. X#include <signal.h>
  2093. X
  2094. wake_me(seconds, func)
  2095. int seconds;
  2096. void (*func)();
  2097. X{
  2098. X    /* set up the signal handler */
  2099. X    signal(SIGALRM, func);
  2100. X    /* get the clock running */
  2101. X    alarm(seconds);
  2102. X}
  2103. X
  2104. END_OF_FILE
  2105. if test 1145 -ne `wc -c <'src/timeit.c'`; then
  2106.     echo shar: \"'src/timeit.c'\" unpacked with wrong size!
  2107. fi
  2108. chmod +x 'src/timeit.c'
  2109. # end of 'src/timeit.c'
  2110. fi
  2111. if test ! -d 'testdir' ; then
  2112.     echo shar: Creating directory \"'testdir'\"
  2113.     mkdir 'testdir'
  2114. fi
  2115. if test -f 'testdir/dc.dat' -a "${1}" != "-c" ; then 
  2116.   echo shar: Will not clobber existing file \"'testdir/dc.dat'\"
  2117. else
  2118. echo shar: Extracting \"'testdir/dc.dat'\" \(142 characters\)
  2119. sed "s/^X//" >'testdir/dc.dat' <<'END_OF_FILE'
  2120. X99
  2121. k
  2122. X2
  2123. v
  2124. p
  2125. q
  2126. X[ calculate the sqrt(2) to 99 decimal places ... John Lions Test ]
  2127. X[ $Header: dc.dat,v 1.1 87/06/22 14:28:28 kjmcdonell Beta $ ]
  2128. END_OF_FILE
  2129. if test 142 -ne `wc -c <'testdir/dc.dat'`; then
  2130.     echo shar: \"'testdir/dc.dat'\" unpacked with wrong size!
  2131. fi
  2132. chmod +x 'testdir/dc.dat'
  2133. # end of 'testdir/dc.dat'
  2134. fi
  2135. if test ! -d 'tmp' ; then
  2136.     echo shar: Creating directory \"'tmp'\"
  2137.     mkdir 'tmp'
  2138. fi
  2139. echo shar: End of archive 1 \(of 4\).
  2140. cp /dev/null ark1isdone
  2141. MISSING=""
  2142. for I in 1 2 3 4 ; do
  2143.     if test ! -f ark${I}isdone ; then
  2144.     MISSING="${MISSING} ${I}"
  2145.     fi
  2146. done
  2147. if test "${MISSING}" = "" ; then
  2148.     echo You have unpacked all 4 archives.
  2149.     rm -f ark[1-9]isdone
  2150. else
  2151.     echo You still need to unpack the following archives:
  2152.     echo "        " ${MISSING}
  2153. fi
  2154. ##  End of shell archive.
  2155. exit 0
  2156.